package com.nalai.market.v1.controller;


import com.nalai.market.v1.service.IOrderService;
import com.nalai.market.v1.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author com.nalai
 * @since 2021-08-23
 */
@RestController
@RequestMapping("/v1/order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @GetMapping("/getOrder/ispay")
    public List<OrderVo> getOrderIspay(){
        return orderService.getOrderIspay();
    }
    @GetMapping("/getOrder/isconfirm")
    public List<OrderVo> getOrderIsconfirm(){
        return orderService.getOrderIsconfirm();
    }
    @GetMapping("/getOrder/issend")
    public List<OrderVo> getOrderIssend(){
        return orderService.getOrderIssend();
    }
    @GetMapping("/getOrder/isreceive")
    public List<OrderVo> getOrderIsreceive(){
        return orderService.getOrderIsreceive();
    }
    @GetMapping("/getOrder/isfinish")
    public List<OrderVo> getOrderIsfinish(){
        return orderService.getOrderIsfinish();
    }

    @GetMapping("/operation/confirm")
    public void operationConfirm(int id){
        orderService.operationConfirm(id);
    }
    @GetMapping("/operation/send")
    public void operationSend(int id){
        orderService.operationSend(id);
    }
    @GetMapping("/operation/receive")
    public void operationReceive(int id){
        orderService.operationReceive(id);
    }
    @GetMapping("/operation/finish")
    public void operationFinish(int id){
        orderService.operationFinish(id);
    }
    @GetMapping("/operation/delete")
    public void operationDelete(int id){
        System.out.println("暂时不删除");
        if(true) return;
        orderService.operationDelete(id);
    }
}
